#!/bin/sh

fprime=../..
build_cache=$fprime/FppTest/build-fprime-automatic-native-ut
srcs="
`find . -name '*.cpp'`
`find ../utils -name '*.cpp'`
`find $build_cache/FppTest/port -name '*.cpp' | grep -v Tester.cpp | grep -v TestMain.cpp`
"
srcs=`echo $srcs | tr '\n' ' '`
flags="
--coverage
--std=c++11
-DBUILD_UT
-DPRIVATE=public
-DPROTECTED=public
-DTGT_OS_TYPE_DARWIN
-I$build_cache
-I$build_cache/F-Prime
-I$build_cache/FppTest/port
-I$fprime
-I$fprime/STest
-I$fprime/cmake/platform/types
-I$fprime/config
-I$fprime/gtest/googletest-src/googletest
-I$fprime/gtest/googletest-src/googletest/include
-I.
"
cmd="g++ -c $flags $srcs"
echo $cmd
$cmd

libs=`find $build_cache -name '*.a'`
ofiles=`ls *.o`
cmd="g++ --coverage $ofiles $libs -o exe"
echo $cmd
$cmd
